/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wli.web.db;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 *
 * @author wli
 */
public class VocabularyHelper {
      Session session = null;

    public VocabularyHelper() {
        this.session = HibernateUtil.getSessionFactory().getCurrentSession();
    }
    
    public List getWordsList() {
    List<String> wordList = null;
    try {
        Transaction tx = session.beginTransaction();
        Query q = session.createQuery ("from Vocabulary");
        wordList = (List<String>)q.list();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return wordList;
}
}
